package com.erpoa.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author chenjimin
 * @Title: BatchInspectInkMapper
 * @ProjectName oaerp
 * @Description: TODO
 * @date 2020/8/2815:16
 */
@Mapper
public interface BatchInspectInkMapper {

    /**
     * @param fmachinecode
     * @param permission
     * @param list
     * @return
     */
    List<Map> selectRecmatDetailByMachine(@Param("fmachinecode") String fmachinecode, @Param("permission") String permission, @Param("list") List<HashMap> list);

    /**
     * @param hrno
     * @return
     */
    List<HashMap> selectallcpgenbyhrno(@Param("hrno") String hrno);

    /**
     * @param fmachinecode
     * @param permission
     * @param list
     * @return
     */
    List<HashMap> selectDataWithfmachinecode(@Param("fmachinecode") String fmachinecode, @Param("permission") String permission, @Param("list") List<HashMap> list);

    /**
     * @param fplanids
     * @return
     */
    List<Map> selectRecmatDetailByFplanids(@Param("fplanids") List<HashMap> fplanids);

    /**
     * @param map
     * @return
     */
    @Insert("  INSERT INTO mg_machinebatchlog (FID,HRNO,FFACTORYCODE,FMACHINECODE,FBATCH,MESSEGE)" +
            " VALUES(#{map.uuid},#{map.hrno},#{map.ffactorycode},#{map.machine},#{map.fbatch},#{map.messege}) ")
    Integer insertScanLog(@Param("map") Map map);


    @Select("       select tc_pgen02 from ds2.tc_pgen_file where tc_pgen01= #{hrno} and rownum=1  ")
    String selectallcpgenbyhrnofirst(@Param("hrno") String hrno);
}
